package com.atlin.project.controller;

import com.atlin.project.utils.ServletUtils;
import eu.bitwalker.useragentutils.UserAgent;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/test")
@Deprecated
public class TestController {

    /**
     * @return
     */
    @GetMapping("/")
    public Object getUserAgent() {
//        UserAgent userAgent = UserAgentParser.parse(ServletUtils.getRequest().getHeader("User-Agent"));
        final eu.bitwalker.useragentutils.UserAgent userAgent = UserAgent.parseUserAgentString(ServletUtils.getRequest().getHeader("User-Agent"));

        return userAgent;
    }
}
